from direct.showbase.DirectObject import DirectObject

class InputHandler(DirectObject):
    def __init__(self):
        self.accept("space", self.on_space)

    def on_space(self):
        print("Space key pressed!")